<div class="col-xs-12 p0" ng-controller="userArticleCtrl" ng-init="getData()">
    <div class="col-xs-12 main-nav">
        <div class="btn-group btn-group-sm r3 fl mr10">
            <a type="button" class="btn btn-default" onclick="history.back(-1);"><i
                    class="iconfont mt-3">&#xe605;&nbsp;</i>后退</a>

            <a type="button" class="btn btn-default btn-sm"
               ng-href="#/user/interface/list?menu_a=menu-project&projectName={{$stateParams.projectName}}&projectId={{$stateParams.projectId}}&moduleId={{$stateParams.moduleId}}">
                <i class="iconfont f12 mt-3">&#xe614; 接口</i>
            </a>

            <button class="btn btn-main cursor-not btn-sm" ng-if="$stateParams.type=='ARTICLE'"><i
                    class="iconfont f12 mt-3">&#xe637; 文章</i></button>

            <a type="button" class="btn btn-default" ng-if="$stateParams.type=='DICTIONARY'"
               ng-href="#/user/article/list?menu_a=menu-project&projectName={{$stateParams.projectName}}&projectId={{$stateParams.projectId}}&moduleId={{$stateParams.moduleId}}&type=ARTICLE">
                <i class="iconfont f12 mt-3">&#xe637; 文章</i>
            </a>
            <a type="button" class="btn btn-default" ng-if="$stateParams.type=='ARTICLE'"
               ng-href="#/user/article/list?menu_a=menu-project&projectName={{$stateParams.projectName}}&projectId={{$stateParams.projectId}}&moduleId={{$stateParams.moduleId}}&type=DICTIONARY">
                <i class="iconfont f12 mt-3">&#xe61c; 数据库表</i>
            </a>

            <button class="btn btn-main cursor-not btn-sm" ng-if="$stateParams.type=='DICTIONARY'"><i
                    class="iconfont f12 mt-3">&#xe61c; 数据库表</i></button>

            <a type="button" class="btn btn-default"
               ng-href="#/user/source/list?menu_a=menu-project&projectName={{$stateParams.projectName}}&projectId={{$stateParams.projectId}}&moduleId={{$stateParams.moduleId}}">
                <i class="iconfont f12 mt-3">&#xe638; 文件</i>
            </a>

            <a type="button" class="btn btn-default" id="refresh" ng-click="getData(list.page.currentPage)"><i
                    class="iconfont mt-3">&#xe611;&nbsp;</i>刷新</a>

            <a type="button" class="btn btn-default btn-sm" ng-if="showOperation('PROJECT',$stateParams.projectId)"
               ng-href="#/user/article/edit?id=NULL&type={{$stateParams.type}}&projectName={{$stateParams.projectName}}&projectId={{$stateParams.projectId}}&moduleId={{$stateParams.moduleId}}&menu_a=menu-project">
                <i class="iconfont mt-3" ng-if="$stateParams.type=='ARTICLE'">&#xe604;&nbsp;新增文章</i>
                <i class="iconfont mt-3" ng-if="$stateParams.type=='DICTIONARY'">&#xe604;&nbsp;新增数据库表</i>
            </a>
            <a type="button" class="btn btn-default btn-sm" ng-if="showOperation('PROJECT',$stateParams.projectId)"
               ng-click="del('user/article/delete.do?ids='+deleteIds,'','确认批量删除选中的文章？')">
                <i class="iconfont mt-3">&#xe60e;</i>&nbsp;批量删除
            </a>
        </div>

        <div class="form-group w200 fl mr10 mb0" ng-if="$stateParams.type=='ARTICLE'">
            <label class="sr-only">类目</label>
            <div class="input-group btn-group-xs">
                <div class="input-group-addon main-bg CFFF b0 f12">类目</div>
                <input type="text" class="form-control input-sm dis-in-blo w120 bl0" readonly placeholder="点击输入框选择类目"
                       id="searchCategory" ng-value="$stateParams.category"
                       ng-focus="loadPickByName('iwidth=150|iheight=170|tag=searchCategory|code=CATEGORY|params=&key='+$stateParams.moduleId +'|def=' + $stateParams.category,$event);">
            </div>
        </div>

        <div class="form-group w200 fl mr10 mb0">
            <label class="sr-only">名称</label>
            <div class="input-group btn-group-xs">
                <div class="input-group-addon main-bg b0 CFFF f12">名称</div>
                <input type="text" class="form-control input-sm dis-in-blo w120 bl0" placeholder="名称" id="searchName"
                       ng-value="$stateParams.name">
            </div>
        </div>

        <button type="button" class="btn btn-adorn btn-sm fl mr10" ng-click="getData(1);">
            <i class="iconfont mt-3">&#xe60d;</i>&nbsp;查询
        </button>
    </div>

    <div class="col-xs-12 p10 mt50">
        <div class="r5 BGFFF p10">
            <table class="table table-hover table-striped">
                <thead>
                <tr class="f14 C000 fw500">
                    <td class="w60"><input type="checkbox" id="select-all"
                                           ng-click="selectAll('select-all','deleteIds',list)">&nbsp;全选
                    </td>
                    <td class="w300">项目名称</td>
                    <td ng-if="$stateParams.type=='PAGE'">key</td>
                    <td ng-if="$stateParams.type=='DICTIONARY'">项目</td>
                    <td ng-if="$stateParams.type=='PAGE'">是否可删除</td>
                    <td ng-if="$stateParams.type=='ARTICLE'">类目</td>
                    <td>状态</td>
                    <td>可评论</td>
                    <td>创建时间</td>
                    <td class="w400">操作</td>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in list">
                    <td><input type="checkbox" name="deleteIds" ng-click="checkboxSelect('deleteIds',item.id)"></td>
                    <td>{{item.name| cut:true:15:' ...'}}</td>
                    <td ng-if="$stateParams.type=='PAGE'">{{item.key}}</td>
                    <td ng-if="$stateParams.type=='DICTIONARY'">{{item.moduleName| cut:true:15:' ...'}}</td>
                    <td ng-if="$stateParams.type=='PAGE'">{{item.canDeleteName}}</td>
                    <td ng-if="$stateParams.type=='ARTICLE'">{{item.category}}</td>
                    <td>{{item.statusName}}</td>
                    <td>{{item.canCommentName}}</td>
                    <td>{{item.createTimeStr}}</td>
                    <td>
                        <a class="f12 main-color mr10 cursor"
                           ng-href="#/user/article/edit?id={{item.id}}&type={{item.type}}&projectName={{item.projectName}}&projectId={{item.projectId}}&moduleId={{item.moduleId}}&menu_a=menu-project">
                            <i class="iconfont f12">&#xe618;修改</i>
                        </a>
                        <a class="f12 main-color mr10 cursor" target="_blank"
                           ng-href="index.do#/article/detail?projectId={{item.projectId}}&moduleId={{item.moduleId}}&type={{item.type}}&id={{item.id}}">
                            <i class="iconfont f12">&#xe60a;预览</i>
                        </a>
                        <a class="f12 main-color mr10 cursor" ng-if="$stateParams.type!='DICTIONARY'"
                           ng-href="#/user/comment/list?projectId={{item.projectId}}&articleId={{item.id}}&menu_a=menu-project&moduleId={{item.moduleId}}">
                            <i class="iconfont f12">&#xe60f;评论列表</i>
                        </a>

                        <a class="f12 main-color mr10 cursor"
                           ng-href="#/user/log/list?menu_a=menu-project&projectName={{item.projectName}}&projectId={{item.projectId}}&moduleId={{item.moduleId}}&identy={{item.id}}">
                            <i class="iconfont">&#xe62b;&nbsp;</i>操作日志
                        </a>
                        <a class="f12 adorn-color mr10 cursor" title="删除"
                           ng-if="showOperation('PROJECT',$stateParams.projectId)"
                           ng-click="del('user/article/delete.do?id='+item.id,item.name)">
                            <i class="iconfont f12">&#xe60e;删除</i>
                        </a>

                    </td>
                </tr>

                </tbody>
            </table>
            <div ui-view="page"></div>
        </div>
    </div>
</div>
<div class="cb"></div>

